

/*
ID: huangmingbo
LANG: JAVA
TASK: friday
*/

import java.io.*;

public class friday {

    public static void main(String[] args) throws IOException {

        try (InputStreamReader reader = new InputStreamReader(friday.class.getResourceAsStream(friday.class.getSimpleName() + ".in"));
             BufferedReader bufferedReader = new BufferedReader(reader);
             PrintWriter printWriter = new PrintWriter(new FileWriter(friday.class.getSimpleName() + ".out"));
        ) {


            int years = Integer.parseInt(bufferedReader.readLine());

            final int monthCount = 12;
            final int weekCount = 7;

            int[] months = new int[]{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
            int[] weekdayCounts = new int[weekCount];
            int[] mods = new int[monthCount + 1];
            int[] leapMods = new int[monthCount + 1];
            for (int i = 1; i < mods.length; i++) {
                mods[i] = (months[i - 1] % weekCount + mods[i - 1]) % weekCount;
                leapMods[i] = i + 1 >= 3 ? mods[i] + 1 : mods[i];
            }


            int day1Mod = 2;
            int[] tmpMod;
            for (int i = 0; i < years; i++) {
                tmpMod = isLeapYear(i) ? leapMods : mods;
                for (int i1 = 0; i1 < monthCount; i1++) {
                    weekdayCounts[(day1Mod + tmpMod[i1] + 12) % weekCount]++;
                }

                day1Mod += tmpMod[monthCount];
            }

            for (int i = 0; i < weekdayCounts.length - 1; i++) {
                printWriter.print(weekdayCounts[i] + " ");
            }

            printWriter.println(weekdayCounts[weekdayCounts.length - 1]);
        }

    }

    private static boolean isLeapYear(int i) {
        int year = 1900 + i;
        return (year % 100 == 0) ? (year % 400 == 0) : (year % 4 == 0);
    }


}
